* s~\t+$~~
[lhc/web/wiklou.git] / includes / HistoryBlob.php
index b407a83..3bf339b 100644 (file)
@@ -31,14 +31,14 @@ class HistoryBlob
         */
        function addItem() {}
 
-       /** 
+       /**
         * Get item by hash
         */
        function getItem( $hash ) {}
-       
+
        # Set the "default text"
        # This concept is an odd property of the current DB schema, whereby each text item has a revision
-       # associated with it. The default text is the text of the associated revision. There may, however, 
+       # associated with it. The default text is the text of the associated revision. There may, however,
        # be other revisions in the same object
        function setText() {}
 
@@ -111,7 +111,7 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob
        }
 
        /** @todo document */
-       function uncompress() { 
+       function uncompress() {
                if ( $this->mCompressed ) {
                        $this->mItems = unserialize( gzinflate( $this->mItems ) );
                        $this->mCompressed = false;
@@ -182,13 +182,13 @@ $wgBlobCache = array();
  * @package MediaWiki
  */
 class HistoryBlobStub {
-       var $mOldId, $mHash;
+       var $mOldId, $mHash, $mRef;
 
        /** @todo document */
        function HistoryBlobStub( $hash = '', $oldid = 0 ) {
                $this->mHash = $hash;
        }
-       
+
        /**
         * Sets the location (old_id) of the main object to which this object
         * points
@@ -197,6 +197,20 @@ class HistoryBlobStub {
                $this->mOldId = $id;
        }
 
+      /**
+       * Sets the location (old_id) of the referring object
+       */
+      function setReferrer( $id ) {
+              $this->mRef = $id;
+      }
+
+      /**
+       * Gets the location of the referring object
+       */
+      function getReferrer() {
+              return $this->mRef;
+      }
+
        /** @todo document */
        function getText() {
                global $wgBlobCache;
@@ -223,7 +237,7 @@ class HistoryBlobStub {
                        if( !in_array( 'object', $flags ) ) {
                                return false;
                        }
-                       
+
                        if( in_array( 'gzip', $flags ) ) {
                                // This shouldn't happen, but a bug in the compress script
                                // may at times gzip-compress a HistoryBlob object row.
@@ -231,12 +245,12 @@ class HistoryBlobStub {
                        } else {
                                $obj = unserialize( $row->old_text );
                        }
-                       
+
                        if( !is_object( $obj ) ) {
                                // Correct for old double-serialization bug.
                                $obj = unserialize( $obj );
                        }
-                       
+
                        // Save this item for reference; if pulling many
                        // items in a row we'll likely use it again.
                        $obj->uncompress();
@@ -269,7 +283,7 @@ class HistoryBlobCurStub {
        function HistoryBlobCurStub( $curid = 0 ) {
                $this->mCurId = $curid;
        }
-       
+
        /**
         * Sets the location (cur_id) of the main object to which this object
         * points